package cn.codeforfun.modules.user.add;

import cn.codeforfun.shared.Borders;
import cn.codeforfun.shared.LookAndFeelUtils;
import lombok.Getter;
import org.springframework.stereotype.Controller;

import javax.annotation.PostConstruct;
import javax.swing.*;
import java.awt.*;

@Controller
@Getter
public class AddFrame extends JFrame {
    JButton addressesBtn;

    @PostConstruct
    protected void prepareFrame() {
        initFrame();
        initComponents();
        pack();
    }

    protected void initFrame() {
        getRootPane().setBorder(Borders.createEmptyBorder());
        setTitle("添加");
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        setLocationRelativeTo(null);
        setResizable(false);
        LookAndFeelUtils.setWindowsLookAndFeel();
        setLayout(new GridLayout(6, 2, 20, 20));
    }

    protected void initComponents() {
        addressesBtn = new JButton("address");
        add(addressesBtn);
    }
}
